package com.wang.service;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wang.mapper.AddSetMapper;
import com.wang.pojo.AddSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class AddSetServiceImpl  extends ServiceImpl<AddSetMapper,AddSet> implements AddSetService {

    @Autowired
    private AddSetMapper addSetMapper;

    @Override
    public AddSet selectByDevId(String  devGId) {

        return addSetMapper.selectOne(new LambdaQueryWrapper<AddSet>().eq(AddSet::getDevGId,devGId));

    }

    @Override
    public void editCheckStatusByDevGId(String devGId, Integer checkStatus) {
        addSetMapper.update(null,new LambdaUpdateWrapper<AddSet>().eq(AddSet::getDevGId,devGId).set(AddSet::getCheckStatus,checkStatus));
    }
}
